import request from '../utils/request';

// 创建寄存酒记录
export const createWine = (data) => {
  return request.post('/wines', data);
};

// 获取寄存酒列表
export const getWines = (params) => {
  return request.get('/wines', { params });
};

// 获取单条寄存酒记录
export const getWineById = (id) => {
  return request.get(`/wines/${id}`);
};

// 更新寄存酒信息
export const updateWine = (id, data) => {
  return request.put(`/wines/${id}`, data);
};

// 取酒操作
export const takeWine = (id) => {
  return request.patch(`/wines/${id}/take`);
};

// 删除寄存酒记录
export const deleteWine = (id) => {
  return request.delete(`/wines/${id}`);
};

// 获取用户寄存酒列表
export const getUserWines = (userId, params) => {
  return request.get(`/wines/user/${userId}`, { params });
};
